package main

import (
	"fmt"
	"sync"
	"time"
)

func main() {
	once := &sync.Once{}
	for i := 0; i < 1000; i++ {
		go func(idx int) {
			once.Do(func() {
				time.Sleep(time.Second)
				fmt.Printf("hello world index: %d\n", idx)
			})
		}(i)
	}
	time.Sleep(time.Second * 5)
}
